package cn.onesdream.app.common.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 错误枚举类基类
 * 1.code=0 -- 成功编码
 * 2.code=999*** -- 系统级错误编码（以999开头，如999001）
 * @author
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ErrorType {
//    public static final ErrorType ERROR_WRONG = new ErrorType("500", "ERROR_WRONG", "操作发生异常，请联系管理员");

    String code = "999001";
    String data = null;
    String msg = "";

    public ErrorType(final String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return String.format("{code:%s,msg:%s,data:%s}", code, msg, data);
    }

}
